package org.ch00.test07.demo03;

import java.util.Random;

/**
 * 天师
 *
 * @author ZQX
 * @date 2025-03-05
 */
public class TianShi extends User {

    /**
     * 偷盗 - 基于接口实现多态
     *
     * @param iBiXie 法器
     */
    public void zhuaYao(IBiXie iBiXie) {
        System.out.println("收你来了！");

        iBiXie.shangHai();

        int rand = new Random().nextInt(10);

        if (rand >= 5) {
            System.out.println("收你成功");
            return;
        }

        System.out.println("收你失败");
    }

}
